<?php
class AppController extends Controller
{
    var $helpers = array('Html', 'Form', 'Javascript', 'Session');
    
    function beforeFilter() {
        parent::beforeFilter();

        $allow_actions = array('display','login', 'register');
        if (!in_array($this->action, $allow_actions)) {
            if ($this->Session->check('account_type') == false) {
                $this->redirect(array('controller' => 'pages', 'action' => 'home'));
            }
        }
    }
}